<div id="content">
	<div class="row s_page_title">
		<sa-big-breadcrumbs [items]="['异常警报','数据丢失检测']" icon="fa fa-exclamation-circle" class="col-xs-12 col-sm-7 col-md-7 col-lg-4"></sa-big-breadcrumbs>
	</div>
	<sa-widgets-grid>
		<div class="s_table">
			<div sa-widget [editbutton]="false" color="darken" class="clearfix">
				<header>
					<span class="widget-icon"> <i class="fa fa-table"></i> </span>
					<h2>数据丢失检测</h2>
				</header>
				<div>
					<div class="widget-body no-padding">
						<div class="page-header clearfix s_table_opreation">
							<div class="left page-header-btn">
								<sa-company-tree-car companyTreeId="companyTree" (companySelected)="companySelected($event)"></sa-company-tree-car>
								<div class="selectDate top_module">
									<table-select-date [notInit]='true' (outerTime)="getSelectTableTime($event)"></table-select-date>
								</div>

								<div class="top_module">
									<span class="module_text">异常类型</span>
									<select name="" id="" class="module_inp" [(ngModel)]="abnormalType">
										<option value="1">无数据</option>
										<option value="2">无GPS</option>
										<option value="3">GPS异常</option>
									</select>
								</div>

								<div class="top_module" style="position: relative;">
									<span class="module_text">异常时间大于</span>
									<input class="module_inp" type="number" [(ngModel)]="minExceptionTime" style="padding:0 42px 0 12px ;" />
									<span class="module_text insideSpan">[小时]</span>
								</div>
								<button type="button" class="btn btn-primary" (click)="table_search()">查询</button>

							</div>
							<div class="right top-search">
								<input type="text" [(ngModel)]="searchKey" (change)="table_search()" class="search-input" placeholder="车牌,设备ID...">
								<span class="top-search-box">
									<button class="top-search-btn" type="button" (click)="table_search()"> <i class="fa fa-search"></i></button>
								</span>
							</div>
						</div>
						<div class="table_scroll">
							<table class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table">
								<thead>
									<tr>
										<!--<th style="width: 55px;"><input type="checkbox" (change)="selectFn()" /></th>-->
										<th>设备ID</th>
										<th>车牌号</th>
										<th>异常类型</th>
										<th>异常时长</th>
										<th>起始时间</th>
										<th>结束时间</th>
										<th>操作</th>

									</tr>
								</thead>
								<tbody>
									<tr *ngFor="let row of tableData; let i = index" [attr.data-index]="i" [ngClass]="{selected:activeSelected === row.id}">
										<!--<td><input type="checkbox" (change)="onCheckboxChangeFn(row.id)" /></td>-->
										<td>{{row.deviceId}}</td>
										<td>{{row.carNumber}}</td>
										<td>
											<span *ngIf="row.exceptionType=='1'">无数据</span>
											<span *ngIf="row.exceptionType=='2'">无GPS</span>
											<span *ngIf="row.exceptionType=='3'">GPS异常</span>
										</td>
										<td>{{row.exceptionTime}}</td>
										<td>{{row.startDate}}</td>
										<td>{{row.endDate}}</td>
										<td>
											<button type="button" (click)="checkAbnormal(row)">查看</button>
											<button type="button" (click)="jumpOptimization(row)">优化</button>
											<button type="button" (click)="delete_row(row)">删除</button>
										</td>

									</tr>
								</tbody>
							</table>
						</div>
						<div class="table-fix clearfix">
							<paginator [totalRecords]="totalCount" [rows]="pageSize" [currentPage]="curPage - 1" (onPageChange)="paginate($event)">
							</paginator>
							<button type="button" class="btn default refresh_btn" (click)="refresh()"><i class="fa fa-refresh"></i></button>
						</div>
					</div>
				</div>
			</div>
		</div>
	</sa-widgets-grid>

	<div style="background: white;border-radius: 5px;margin-top: 5px;position: relative;" [hidden]="!isChartView">
		<button (click)="closeChart()" class="div_closeBtn"> × </button>
		<div class="widget-body no-padding" style="margin: 0;">
			<div class="page-header clearfix s_table_opreation" style="margin: 0;">
				<div class="left page-header-btn" style="padding: 5px;">
					<div class="top_module">
						<span class="module_text" style="background: none;">异常数据折线图</span>
					</div>
					<div style="display: inline-block;">
						<div>
							<div class="selectDate top_module">
								<table-select-date [notInit]='true' [specifyId]='specifyId' [specifyTime]='specifyTime' (outerTime)="getSelectChartTime($event)"></table-select-date>
							</div>
							<button type="button" class="btn btn-primary" (click)="drawAbnormalChart()">查看</button>
						</div>
					</div>
				</div>
			</div>
		</div>
		<sa-chart-bmap [height]='325' [offDatas]='true' [inputParams]='selectedRow' [isBaiduMap]='true' (outerSend)="runParent($event)" (outerIsMap)='showMapView($event)'></sa-chart-bmap>
		<div [hidden]='!isMapView'>
			<sa-bmap-chart [trackParams]='drawTrackArr' [isShowBmap]='isMapView' deviceId="deviceId"></sa-bmap-chart>
		</div>


	</div>
</div>